package org.aeon.service;

import org.aeon.entity.ChatMessage;
import org.aeon.service.impl.UserMessageServiceImpl;

import java.util.Date;
import java.util.List;

/**
 * @author: MissingAeon
 * @date: 2024/1/27 9:29
 * @description:
 */
public interface UserMessageService {
    UserMessageService service = new UserMessageServiceImpl();

    /**
     * 记录消息
     *
     * @param message
     * @return
     */
    boolean writeMessages(ChatMessage message, Long userId);

    /**
     * 获取与目标的消息记录
     *
     * @param userId
     * @param targetId
     * @return
     */
    List<ChatMessage> readMessagesByTimeToRange(Long userId, Long targetId, Long start, int count);

    /**
     * 获取与目标的消息记录
     *
     * @param userId
     * @param targetId
     * @return
     */
    List<ChatMessage> readMessagesByTime(Long userId, Long targetId, Date date);
}
